#ifndef __HCSR04_H__
#define __HCSR04_H__

#include <stdint.h>
#include "Motor.h"

#define HC_CHECK_FLAG	((uint8_t)0x01)
#define HC_CTRCAR_FLAG	((uint8_t)0x02)

typedef enum{
	HC_RESET,  //以0递增
	HC_SET
}HC_SetValue;

typedef struct{
	uint8_t HCSR04_CheckFlag;
	uint8_t HCSR04_CtrCarFlag;
}HCSR04_Flag;

extern uint16_t Timer;

void HCSR04_Init(void);
uint8_t HCSR04_GetDistace(void);
void HCSR04_CtrMasterCar(SetMotor_Speed* HC_Speed);
uint8_t HCSR04_GetFlag(uint8_t HC_Flag);
void HCSR04_SetFlag(uint8_t HC_Flag,HC_SetValue Value);
float HCSR04_GetServoAngle(void);

#endif
